package com.buobao.reflect.demo.entity;

import java.util.Date;

public class Employee {
    static {
        System.out.println("employee is loaded.");
    }
    private int eno;
    private String ename;
    private float salary;
    private String dname;
    private Date hireDate;

    public Employee(){
        System.out.println("employee constructor is call");
    }

    public Employee(int eno, String ename, float salary, String dname, Date hireDate) {
        this.eno = eno;
        this.ename = ename;
        this.salary = salary;
        this.dname = dname;
        this.hireDate = hireDate;
    }

    public int getEno() {
        return eno;
    }

    public void setEno(int eno) {
        this.eno = eno;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public float getSalary() {
        return salary;
    }

    public void setSalary(float salary) {
        this.salary = salary;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public Date getHireDate() {
        return hireDate;
    }

    public void setHireDate(Date hireDate) {
        this.hireDate = hireDate;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "eno=" + eno +
                ", ename='" + ename + '\'' +
                ", salary=" + salary +
                ", dname='" + dname + '\'' +
                ", hireDate=" + hireDate +
                '}';
    }

    public Employee updateSalary(Float val) {
        this.salary += val;
        System.out.println("update salary success.");
        return this;
    }

    private Employee chageName(String name) {
        this.ename = name;
        System.out.println("name change success.");
        return this;
    }
}
